

import axios from '../../axios'
const ADMIN_URL='/admin';
const adminApi = {
  //获取所有管理员
   getAllAdmins(data){
    
       return axios({
         url:"/admin/getAllAdmins",
         method:"post",
         data
       })
   },
   //登录
    login(data) {
     
       return axios({
        url: ADMIN_URL+"/login",
        method: "post",
        data
       })
    },
    //增加管理员
   addAdmin(data) {
    return axios({
        url: "/admin/addAdmin",
        method: "post",
        data
    })  
   },
   
  //  register(data){
  //   return axios({
  //     url: "/admin/register",
  //     method: "post",
  //     data
  // }) 
  // },
  // 删除根据id
  deleteAdminByID(_id){
    return axios({
      url: "/admin/deleteAdminByID",
      method: "post",
      data:{
        _id
      }
  }) 
  },
  //查找根据id
  getAdminById(_id){
    return axios({
      url: "/admin/getAdminById",
      method: "post",
      data:{
        _id
      }
  }) 
  },
  //修改根据id
  updateAdmin(data){
    return axios({
      url: "/admin/updateAdmin",
      method: "post",
      data
  }) 
  },
  //是否登录
  isLogin(){    
    return axios({
      url: "/admin/isLogin",  
      method: "post",
     
  }) 
  }
}

export default adminApi;